package com.cloud.springcloud.alibaba.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @auther hxx
 * alibaba jar 中 带有负载ribb 包 负载
 * @create 2020-02-23 14:45
 */


@Configuration
public class ApplicationContextConfig {


    @Bean
    @LoadBalanced       //自带负载均衡     调用时候要加  不加就报错
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
